package com.example.analysis.controller;

import com.example.analysis.domain.EvaluateListInfo;
import com.example.analysis.domain.ScoreInfo;
import com.example.analysis.domain.TimeInfo;
import com.example.analysis.entity.Class;
import com.example.analysis.entity.Course;
import com.example.analysis.service.EvaluateListStudentService;
import com.example.analysis.utils.Response1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.w3c.dom.html.HTMLImageElement;

import java.util.List;

/**
 * @Author：txy
 * @name：StudentEvaluateAnalysis
 * @Date：2025/4/22
 * @Filename：StudentEvaluateAnalysis
 */
@RestController
@RequestMapping("/studentEvaluate")
public class StudentEvaluateAnalysis {

    @Autowired
    EvaluateListStudentService evaluateListStudentService;

    @GetMapping("/course/{semester}")
    public Response1<List<ScoreInfo>> getCourse(@PathVariable("semester") String semester){
        List<ScoreInfo> list=evaluateListStudentService.getCourse(semester);
        Response1<List<ScoreInfo>> listResponse1 = new Response1<>(20000, "成功", list);
        return listResponse1;
    }

    @GetMapping("/class")
    public Response1<List<Class>> getClass(@RequestParam("subId") String subId,@RequestParam("semester") String semester){
        List<Class> list=evaluateListStudentService.getByClassId(subId,semester);
        Response1<List<Class>> listResponse1 = new Response1<>(20000, "成功", list);
        return listResponse1;
    }

    //评教数据
    @GetMapping("/evaluateOne")
    public Response1<List<EvaluateListInfo>> getBySemester(EvaluateListInfo evaluateListInfo){
       List<EvaluateListInfo> list=evaluateListStudentService.getList(evaluateListInfo);
       return new Response1<>(20000,"成功",list);
    }

    @GetMapping("/time")
    public Response1<List<TimeInfo>> getTimeInfo(EvaluateListInfo evaluateListInfo){
        List<TimeInfo> list=evaluateListStudentService.getTimeInfo(evaluateListInfo);
        return new Response1<>(20000,"成功",list);
    }

    @GetMapping("/diffSemester")
    public Response1<List<TimeInfo>> getDiffSemester(EvaluateListInfo evaluateListInfo){
        List<TimeInfo> list=evaluateListStudentService.getDiffSemester(evaluateListInfo);
        return new Response1<>(20000,"成功",list);
    }

    @GetMapping("/classOne")
    public Response1<List<Course>> getClassOne(){
        List<Course> list=evaluateListStudentService.getClassOne();
        return new Response1<>(20000,"成功",list);
    }

}
